package User;

import Book.Library;
import Operation.*;

import java.util.Scanner;

public class AdminUser extends Users{
    public AdminUser(String name) {
    super(name);
    this.iOperation = new IOperation[]{
            new ExitBook(),
            new FindBook(),
            new ShowBook(),
            new AddBook(),
            new DelBook()};
    }
    @Override
    public int menu() {
        System.out.println("====================");
        System.out.println("Hello " + this.getName() + " 这是管理员菜单");
        System.out.println("1、找书");
        System.out.println("2、展书");
        System.out.println("3、增书");
        System.out.println("4、删书");
        System.out.println("0、退出");
        System.out.println("====================");
        System.out.println("请选择操作：");
        Scanner sc = new Scanner(System.in);
        return sc.nextInt();
    }

    @Override
    public void doOperation(int pos, Library library) {
        iOperation[pos].work(library);
    }

}
